<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@  page import="software_2.* ,java.util.ArrayList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>answer page</title>

<script type="text/javascript">
var c=0

function timedCount()
{
document.getElementById('txt').value=c
c=c+1
t=setTimeout("timedCount()",1000)
}
</script>

</head>
<body onload="timedCount()">
<%String str="";
String button="提交";
String language=(String)request.getParameter("language");
String time="计时： ";
try{
if(language.equals("complex")){button="確定";time="計時: ";}
else if(language.equals("English")){button="Submit";time="Time: ";}
}catch(NullPointerException e){
	 button="提交";
}
str = request.getParameter("quantity");
int n = Integer.parseInt(str);
session.setAttribute("n", str);%>
<form action="result.jsp" method="post">
<%out.print(time); %> <input type="text" style="border:0;background:transparent;" name="time" id="txt"><br/><br/>
<% 

int m = n/3;                                                        //分数题型题量占三分之一
int qnum=1;
int count=1;
for(int i=0;i<(n-m);i++,qnum++,count++){                                           //开始随机出整数题型
	String[] intQuestion= new String[2];
	 intQuestion = CreateIntQuestion.CreateQuestion();
	out.print("["+qnum+"] ");%>&nbsp;&nbsp;&nbsp;&nbsp;<%
	out.print(intQuestion[0]);
	%>
	 <input type="text" name="ans<%out.print(i+1);%>" >
		<input type="hidden" name="key<%out.print(i+1);%>" value="<%out.print(intQuestion[1]);%>">
		&nbsp;&nbsp;&nbsp;&nbsp;
	 <%if(count==3){%><br/><br/><% count=0;}
	}
int count2=0;
for(int j=0;j<m;j++,qnum++,count2++){
	String[] fracQuestion=new String[2];
	fracQuestion =CreateFracQuestion.CreateFQuestion();
	out.print("["+qnum+"] ");%>&nbsp;&nbsp;&nbsp;<%
	out.print(fracQuestion[0]);
	%>
	 <input type="text" name="ans<%out.print((n-m)+j+1);%>" >
		<input type="hidden" name="key<%out.print((n-m)+j+1);%>" value="<%out.print(fracQuestion[1]);%>">
		&nbsp;&nbsp;&nbsp;&nbsp;
	 <%if(count2==3){%><br/><br/><% count2=0;}
<<<<<<< HEAD
}%>
<input type="hidden" name="language" value="<%out.print(language); %>">
=======
}
long start=System.currentTimeMillis();%>
<input type="hidden" name="language" value="<%out.print(language); %>">
 <input type="hidden" name="starttime" value="<%out.print(start);%>">
>>>>>>> 3029cb19dd330cf73eaa6cd98bf0886b09007755
 <br/> <br/>
<input type="submit" value="<%out.print(button);%>">
 </form>

</body>
</html>